"""
@author: wg
@file: 盘龙数组.py
@time: 2023/12/12 21:48
"""

# 使用python实现5行5列的盘龙数组

# 定义数组大小
rows = 5
cols = 5

# 定义盘龙数组初始值
dragon = [[0] * cols for _ in range(rows)]

# 填充盘龙数组
for i in range(rows):
    for j in range(cols):
        if j == 0 or j == cols - 1 or i == 0 or i == rows - 1:
            dragon[i][j] = 1
        elif i == j or i + j == rows - 1:
            dragon[i][j] = 2
        else:
            dragon[i][j] = 0

        # 输出盘龙数组
for row in dragon:
    print(row)

